package com.xgkj.diyiketang.task;

import com.alibaba.fastjson.JSONObject;
import com.xgkj.diyiketang.http.CouponHttpRequest;
import com.xgkj.diyiketang.http.CouponHttpResponse;
import com.xgkj.diyiketang.http.engine.CouponHttpBaseTask;
import com.xgkj.diyiketang.http.engine.TaskResultCode;


public class LiveCommentTask extends CouponHttpBaseTask {

    private String mvid;
    private String mContents;

    public LiveCommentTask(String vid, String content) {
        super();
        mvid = vid;
        mContents = content;
    }

    @Override
    protected void processResponseData(CouponHttpResponse response) {
        notifyTaskCompleted(TaskResultCode.SUCCESS, null);
    }

    @Override
    protected void prepareRequest() {
        super.prepareRequest();
        if (mPhase == TASK_PHASE_INIT) {
            CouponHttpRequest request = new CouponHttpRequest();
            JSONObject json = new JSONObject();
            json.put("vid", mvid);
            json.put("content", mContents);
            request.setData(json.toString());
            request.setApiNo(ApiNo.LIVECOMMENT);
            addRequest(request);
        }
    }


}
